import React from 'react';
import ReactDom from 'react-dom';
import Facialmask from './diyselect/components/Facialmask.js';
import FacialmaskOrder from './diyselect/components/FacialmaskOrder.js'
import FacialmaskAddress from './diyselect/components/FacialmaskAddress.js'
import FacialmaskResult from './diyselect/components/FacialmaskResult.js'
import FacialmaskUser from './diyselect/components/FacialmaskUser.js'
import FacialmaskDiscount from './diyselect/components/FacialmaskDiscount.js'
import FacialmaskOrderList from './diyselect/components/FacialmaskOrderList.js'
import ConfirmAdd from './diyselect/components/ConfirmAdd.js'
import FailAdd from './diyselect/components/FailAdd.js'
import FacialmaskAddr from './diyselect/components/FacialmaskAddr.js'
import {Router,Route,browserHistory} from 'react-router';
import {DynPath,customerInfo,ROOTURL,getParamValue} from './publicAPI/publicAPI.js'
import initReactFastclick from 'react-fastclick';
initReactFastclick();
require('./common.css');
import calculateFontSize from './rem'
calculateFontSize();
var openid=getParamValue("openid")
localStorage.setItem("openid", JSON.stringify(openid));
var logining = sessionStorage.getItem('logining');
if (!logining) {
   sessionStorage.setItem('logining', true);
// location.href = ROOTURL+'user/wxmp-xs-snsapi-base.api?redirCode=' + encodeURIComponent(ROOTURL+'customer/login-register-wxmp.api') + '&redir=' + encodeURIComponent(location.href);
// location.href = "http://diy1.fashcollege.com/pepper/user/wxmp-xs-snsapi-base.api?redirCode=http%3A%2F%2Fdiy1.fashcollege.com%2Fpepper%2Fcustomer%2Flogin-register-wxmp.api&redir="+encodeURIComponent(location.href);
location.href = ROOTURL+'customer/login-register-wxmp.api?redir=' + encodeURIComponent(location.href);

};

ReactDom.render(
    <Router history={browserHistory}>
	    <Route path='/' component={Facialmask}/>
		<Route path='/order' component={FacialmaskOrder}/>
		<Route path='/address' component={FacialmaskAddress}/>
		<Route path='/result' component={FacialmaskResult}/>
		<Route path='/user' component={FacialmaskUser}/>
		<Route path='/discount' component={FacialmaskDiscount}/>
		<Route path='/orderlist' component={FacialmaskOrderList}/>
		<Route path='/addr' component={FacialmaskAddr}/>
		<Route path='/confirmadd' component={ConfirmAdd}/>
		<Route path='/failadd' component={FailAdd}/>
	</Router>,document.getElementById('content')
);

